{% extends 'myblog/base.html' %}

{% block title %}
    学无止境
{% endblock %}

{% block content %}
    <article>
        <h1 class="t_nav">
            <span>您现在的位置是：学无止境 > {{ article.art_type }} </span>
            <a href="/myblog/index/" class="n1">首页</a>
            <a href="/myblog/list/" class="n2">学无止境</a>
        </h1>
        <div class="blogs">
            <div class="mt20"></div>
            {% for art in page_obj %}
                <li>
                    <span class="blogpic">
                        <a href="/myblog/info/?id={{ art.id }}">
                            <img src="/static/{{ art.art_img }}">
                        </a>
                    </span>
                    <h3 class="blogtitle">
                        <a href="/myblog/info/?id={{ art.id }}">{{ art.art_title }}</a>
                    </h3>
                    <div class="bloginfo">
                        {{ art.art_description | safe }}
                    </div>
                    <div class="autor">
                    <span class="lm">
                        <a href="/myblog/list/?type_id={{ art.art_type_id }}" title="{{ art.art_type }}"
                           class="classname">{{ art.art_type }}</a>
                    </span>
                        <span class="dtime">{{ art.art_date }}</span>
                        <span class="viewnum">浏览（<a href="/">{{ art.art_click }}</a>）</span>
                        <span class="readmore"><a href="/myblog/info/?id={{ art.id }}">阅读原文</a></span>
                    </div>
                </li>
            {% endfor %}




            <div class="pagelist">

                {% if page_obj.number > 1 %}
                    <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page=1" title="Total record">首页</a>
                {% endif %}
                {% if page_obj.has_previous %}
                    <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page={{ page_obj.previous_page_number }}">上一页</a>
                {% endif %}
                {% for one in page_range %}
                    {% if one == page_obj.number %}
                        <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page={{ one }}"
                           style="color: red">{{ one }}</a>&nbsp;
                    {% else %}
                        <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page={{ one }}">{{ one }}</a>
                        &nbsp;
                    {% endif %}
                {% endfor %}
                {% if page_obj.has_next %}
                    <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page={{ page_obj.next_page_number }}">下一页</a>
                {% endif %}
                {% if page_obj.has_next %}
                    <a href="/myblog/list/?type_id={{ type_art.first.art_type_id }}&page={{ paginator.num_pages }}">尾页</a>
                {% endif %}


            </div>
        </div>
        <div class="sidebar">
{#            <div class="search">#}
{#                <form action="/e/search/index.php" method="post" name="searchform" id="searchform">#}
{#                    <input name="keyboard" id="keyboard" class="input_text" value="请输入关键字"#}
{#                           style="color: rgb(153, 153, 153);"#}
{#                           onfocus="if(value=='请输入关键字'){this.style.color='#000';value=''}"#}
{#                           onblur="if(value==''){this.style.color='#999';value='请输入关键字'}" type="text">#}
{#                    <input name="show" value="title" type="hidden">#}
{#                    <input name="tempid" value="1" type="hidden">#}
{#                    <input name="tbname" value="news" type="hidden">#}
{#                    <input name="Submit" class="input_submit" value="搜索" type="submit">#}
{#                </form>#}
{#            </div>#}


            <div class="lmnav" style="margin-top: 20px">
                <h2 class="hometitle">栏目导航</h2>
                <ul class="navbor">
                    <li><a href="#">学无止境</a></li>
                    <li><a href="list.html"></a>
                        <ul>
                            {% for cou in course %}
                                <li><a href="/myblog/list/?type_id={{ cou.id }}&page=1">{{ cou.course_name }}</a></li>
                            {% endfor %}
                        </ul>
                    </li>

                </ul>
            </div>

            <div class="cloud">
                <h2 class="hometitle">标签云</h2>
                <ul>
                    {% for subject in tags %}
                        <a href="/myblog/list/?type_id={{ subject.id }}&page=1">{{ subject.course_name }}</a>
                    {% endfor %}
                    <a href="/myblog/share/">照片墙</a>
                </ul>
            </div>

            <div class="paihang">
                <h2 class="hometitle">点击排行</h2>
                <ul>
                    {% for click in click_art %}
                        <li>
                            <b>
                                <a href="/myblog/info/?id={{ click.id }}" target="_blank">{{ click.art_title }}</a>
                            </b>
                            <p>
                                <i>
                                    <img src="/static/{{ click.art_img }}">
                                </i>
                                {{ click.art_description | safe }}
                            </p>
                        </li>
                    {% endfor %}
                </ul>
            </div>

        </div>
    </article>
{% endblock %}